import { Int64BE } from 'int64-buffer'
import msgpack from 'msgpack-lite'
export default function (i, serverData, roundId, tabid) {
  const ts = new Date().getTime()
  const data = {
    i: Int64BE(serverData.source_id),
    b: Int64BE(tabid),
    d: 0,
    p: 89,
    z: 66,
    o: serverData.source,
    t: Int64BE(ts),
    m: {
      t: i,
      i: roundId
    }
  }
  const buffer = msgpack.encode(data)
  return buffer
}
